<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  function* gen() {
    let char = yield  'A'
    console.log(char);
   let char1 = yield 'B'
    console.log(char1);
   yield  'C'
  }

  let ge = gen()
  console.log(ge.next().value);//A
  console.log(ge.next(2).value);//B
  console.log(ge.next().value);


</script>
</body>
</html>